package com.xkdx.caipiao.module.network;

import java.io.BufferedReader;
import java.io.InputStream;
import java.io.InputStreamReader;

import com.alibaba.fastjson.JSON;


public class JsonHttpRequest extends AbsHttpsRequest {
	private String TAG = "CommentHttpRequest";

	@Override
	protected String parseContent(InputStream data, boolean fromCache) throws Exception {
		String str = getContent(data);
		backResult =JSON.parseArray(str);
		return str;
		
	}

	private String getContent(InputStream data) throws Exception {
		String str = null;
		BufferedReader r = null;
		StringBuffer sb = new StringBuffer();

		try {
			r = new BufferedReader(new InputStreamReader(data));

			String line;
			while ((line = r.readLine()) != null) {
				sb.append(line);
			}
			str = sb.toString();
		} catch (Exception e) {
			e.printStackTrace();
			throw e;
		}

		return str;
	}

}
